package com.by.bean;

import com.by.common.group.ISave;
import com.by.common.group.IUpdate;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@ApiModel("部门")
@Data
public class Dept {

    @NotNull(message = "修改时部门ID不能为空",groups = {IUpdate.class})
    Integer id;
    @ApiModelProperty(value = "部门名称", required = true)
    @NotBlank(message = "部门名称不能为空",groups = {ISave.class, IUpdate.class})
    String name;

    @ApiModelProperty(value = "上级部门ID,顶级部门为0", required = true)
    int parentId;

    @ApiModelProperty(hidden = true,value = "部门编码")
    String deptCode;
}
